const Router = require("express").Router;
const router = new Router();
const UserController = require("../controllers/userController.js");
const uservalidator = require("../validator/userValidator");
const authMiddleware = require("../middleware/authMiddleware");
router.post(
  "/registration",
  uservalidator.validateRegistration,
  UserController.registration
);
router.post("/login", uservalidator.validateLogin, UserController.login);
router.post("/logout", UserController.logout);
router.post(
  "/reset-password",
  uservalidator.validateEmail,
  UserController.reset_password
);
router.post("/recover-password/:link", UserController.recover_password);
router.get("/activate/:link", UserController.activate);
router.get("/refresh", UserController.refresh);
router.get("/users", authMiddleware, UserController.getUsers);

module.exports = router;

// /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
